package org.bluedream.core.module.entity.goods;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.bluedream.comm.base.OrgPageEntity;
import org.bluedream.comm.utils.excel.ExcelType;
import org.bluedream.comm.utils.excel.FieldType;
import org.bluedream.core.module.entity.clsItem.ClsItem;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName depItemUser
 * @Description TODO
 * @Author foxsand
 * @Data 2021-07-23 16:34
 * @Version
 */
@Data
@ToString(callSuper = true)
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "goods")
public class Goods extends OrgPageEntity<Goods> {
    private static final long serialVersionUID = -5648682279628349903L;
    @NonNull
    @FieldType(excelType = ExcelType.ALL , excelFieldName = "代码" , fieldSort = 0)
    private String code;
    @NonNull
    @FieldType(excelType = ExcelType.ALL , excelFieldName = "条码" , fieldSort = 1)
    private String barcode;
    @NonNull
    @FieldType(excelType = ExcelType.ALL , isRequired = true , excelFieldName = "名称" , fieldSort = 2)
    private String name;
    @NonNull
    @FieldType(excelType = ExcelType.ALL , isRequired = true , excelFieldName = "品类代码" , fieldSort = 3)
    private String clsCode;
    @FieldType(excelType = ExcelType.IMPORT , isRequired = false , excelFieldName = "品牌代码" , fieldSort = 4)
    private String brandCode;
    @FieldType(excelType = ExcelType.IMPORT , isRequired = false , excelFieldName = "单位" , fieldSort = 5)
    private String spec;
    @FieldType(excelType = ExcelType.IMPORT , isRequired = false , excelFieldName = "规格" , fieldSort = 6)
    private String unit;
    @FieldType(excelType = ExcelType.IMPORT , isRequired = false , excelFieldName = "包装数量" , fieldSort = 7)
    private Integer qpc;
    @FieldType(excelType = ExcelType.ALL , isRequired = true , excelFieldName = "进价" , fieldSort = 8)
    private BigDecimal oprice;
    private String qpcStr;

    @TableField(exist = false)
    private ClsItem clsItem;
    @TableField(exist = false)
    private BrandItem brandItem;

    @TableField(exist = false)
    private String clsName;
    @TableField(exist = false)
    private String brandName;

    @TableField(exist = false)
    private List<Product> productList;

    @TableField(exist = false)
    private String msgStatus;

    public Goods(String id) {
        this.id = id;
    }

    public Goods(long limit , long pageSize) {
        this.limit = limit;
        this.page = pageSize;
    }
}
